import { createWebHistory, createRouter } from 'vue-router'

import Home from '../page/Home.vue'
import Login from '../page/Login.vue'
import Register from '../page/Register.vue'
import StyleHome from '../components/homeStyle.vue'

const routes = [

  { path: '/', component: Login },
  { path: '/register', component: Register },
  {
    path: '/home',
    redirect: '/home/styleHome',
    component: Home,
    children:[
      {
        path:'styleHome',
        component:StyleHome
      },{
        path:'userManage',
        component:() => import('../components/userManage.vue')
      },{
        path:'file',
        component:() => import('../components/file.vue')
      }
    ]
  },{
    path: '/:catchAll(.*)',
    name: 'NotFound',
    component:() => import('../components/notFound/index.vue')
  }
]

const router = createRouter({
  
  history: createWebHistory(),
  routes,
})


export default router